package com.jsp.study.bean;

public class Email {
	private String mailAdd;
	private boolean email;
	public Email() {
		super();
	}
	public Email(String mailAdd) {
		super();
		this.mailAdd = mailAdd;
	}
	
	// 判断邮箱是否合法
	public boolean isEmail() {
		String regex = "\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*";
		if (mailAdd.matches(regex)) {
			email = true;
		} else {
			email = false;
		}
		return email;
	}
	public String getMailAdd() {
		return mailAdd;
	}
	public void setMailAdd(String mailAdd) {
		this.mailAdd = mailAdd;
	}
	
}
